<!doctype html>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/modules/cms/front/include/taglib.jsp"%>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>山东林业扶贫项目</title>
  <meta name="description" content="山东林业扶贫项目">
  <meta name="keywords" content="index">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="icon" type="image/png" href="${ctxStatic}/sdlyfp/i/favicon.png">
  <link rel="apple-touch-icon-precomposed" href="${ctxStatic}/sdlyfp/i/app-icon72x72@2x.png">
  <meta name="apple-mobile-web-app-title" content="Amaze UI" />
  <link rel="stylesheet" href="${ctxStatic}/sdlyfp/css/amazeui.min.css" />
  <link rel="stylesheet" href="${ctxStatic}/sdlyfp/css/admin.css">
  <link rel="stylesheet" href="${ctxStatic}/sdlyfp/css/app.css">
  <script src="${ctxStatic}/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
  <link rel="stylesheet" href="${ctxStatic}/sweetalert/sweetalert.css">
  <script src="${ctxStatic}/sweetalert/sweetalert.min.js"></script>
  <script src="${ctxStatic}/sdlyfp/js/base.js"></script>
  
</head>

<body data-type="generalComponents">

	<!-- head -->
	<jsp:include page="head.jsp" flush="false"></jsp:include>
	
	<div class="tpl-page-container tpl-page-header-fixed">
	
	<!-- 菜单 -->
	<jsp:include page="menu.jsp" flush="false"></jsp:include>

	
	
	
	<div class="tpl-content-wrapper">
            <div class="tpl-content-page-title">
               	组织机构设置
               	
               	<c:if test="${fns:getUser().area.type gt 2}">
            	&nbsp;<font style="font-size: 17px;" color="red"><b>提示：
            	在填写各项任务目标时，请勿随意填写数字，必须按照实际值填写，否则将直接导致数据统计错误；对于不确定的任务目标请填写数字0。</b></font>
            	</c:if>
            </div>
            <ol class="am-breadcrumb">
                <li><a href="#" class="am-icon-home">首页</a></li> 
                <li class="am-active">组织机构设置</li>
            </ol>
            <div class="tpl-portlet-components">
                <div class="portlet-title">
                    <div class="caption font-green bold">
                        <span class="am-icon-code"></span> ${not empty area.id?'修改':'添加'}组织机构
                    </div>
                    <div class="tpl-portlet-input tpl-fz-ml">
                        <div class="portlet-input input-small input-inline">
                            <div class="input-icon right"></div>
                        </div>
                    </div>

                </div>
                <div class="tpl-block">
                    <div class="am-g">
                        <div class="tpl-form-body tpl-form-line">
                            <form class="am-form tpl-form-line-form" method="post" action="${ctx }/gt/area/save">
                            	
                            	<input type="hidden" name="id" value="${area.id }"/>
                            	<input type="hidden" id="menuId" name="menuId" value="${gtArea.menuId }"/>
                            	
                                <div class="am-form-group">
                                    <label for="user-name" class="am-u-sm-3 am-form-label">上级区域  </label>
                                    <div class="am-u-sm-9">
                                    	<input type="hidden" name="parent.id" value="${area.parent.id }"/>
                                        <input type="text" name="parent.name" readonly="readonly" value="${area.parent.name }" class="tpl-form-input" id="user-name" placeholder="请选择上级区域">
                                        <!-- <small>选择上级区域</small> -->
                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label class="am-u-sm-3 am-form-label">区域名称 </label>
                                    <div class="am-u-sm-9">
                                        <input type="text" id="name" name="name" value="${area.name}" placeholder="">
                                    </div>
                                </div>

                                 <%-- <div class="am-form-group">
                                    <label class="am-u-sm-3 am-form-label">区域编码 </label>
                                    <div class="am-u-sm-9">
                                        <input type="text" name="code" value="${area.code}" placeholder="">
                                    </div>
                                 </div> --%>
                                 <input type="hidden" name="code" value="${area.code}" placeholder="">
                                 
                                 <div class="am-form-group">
                                    <label class="am-u-sm-3 am-form-label">类型</label>
                                    <div class="am-u-sm-9">
                                    	<input type="hidden" id="type" name="type" value="${not empty area.id ? area.type:area.parent.type+1}"/>
                                        <select id="type" disabled="disabled" class="input-mini">
											<option value="">---请选择---</option>
											<c:forEach items="${types }" var="type">
												<option ${not empty area.id and area.type eq type.value ? 'selected':
												empty area.id and area.parent.type+1 eq type.value?'selected':''} value="${type.value }" >${type.label }</option>
											</c:forEach>
										</select>
                                    </div>
                                 </div>
                                 
                                 <%-- <div class="am-form-group">
                                    <label class="am-u-sm-3 am-form-label">序号</label>
                                    <div class="am-u-sm-9">
                                        <input id="sort" type="text" name="sort" value="${area.sort}" placeholder="">
                                    </div>
                                 </div> --%>
                                 <input id="sort" type="hidden" name="sort" value="${area.sort}" placeholder="">
                                 
                                 <div class="am-form-group">
                                    <label class="am-u-sm-3 am-form-label">经济林任务目标</label>
                                    <div class="am-u-sm-9">
                                        <input type="text" id="forestArea" name="forestArea" value="${area.forestArea}" placeholder="请务必填写正确的数字，勿随意填写，不确定请填0">
                                    </div>
                                 </div>
                                 <div class="am-form-group">
                                    <label class="am-u-sm-3 am-form-label">经济林帮扶带动人口任务目标</label>
                                    <div class="am-u-sm-9">
                                        <input type="text" id="forestPeople" name="forestPeople" value="${area.forestPeople}" placeholder="请务必填写正确的数字，勿随意填写，不确定请填0">
                                    </div>
                                 </div>
                                 <div class="am-form-group">
                                    <label class="am-u-sm-3 am-form-label">护林岗位任务目标</label>
                                    <div class="am-u-sm-9">
                                        <input type="text" id="rangerPost" name="rangerPost" value="${area.rangerPost}" placeholder="请务必填写正确的数字，勿随意填写，不确定请填0">
                                    </div>
                                 </div>
                                 <div class="am-form-group">
                                    <label class="am-u-sm-3 am-form-label">龙头企业任务目标</label>
                                    <div class="am-u-sm-9">
                                        <input type="text" id="leadCompany" name="leadCompany" value="${area.leadCompany}" placeholder="请务必填写正确的数字，勿随意填写，不确定请填0">
                                    </div>
                                 </div>
                                 <div class="am-form-group">
                                    <label class="am-u-sm-3 am-form-label">合作社任务目标</label>
                                    <div class="am-u-sm-9">
                                        <input type="text" id="coop" name="coop" value="${area.coop}" placeholder="请务必填写正确的数字，勿随意填写，不确定请填0">
                                    </div>
                                 </div>
                                 <div class="am-form-group">
                                    <label class="am-u-sm-3 am-form-label">省定贫困村覆盖个数目标</label>
                                    <div class="am-u-sm-9">
                                        <input type="text" id="countryTotal" name="countryTotal" value="${area.countryTotal}" placeholder="请务必填写正确的数字，勿随意填写，不确定请填0">
                                    </div>
                                 </div>

                                <div class="am-form-group">
                                    <div class="am-u-sm-9 am-u-sm-push-3">
                                        <button type="submit" onclick="return doSubmit();" class="am-btn am-btn-primary tpl-btn-bg-color-success ">保存</button>
										 <button type="button" onclick="goBack();" class="am-btn am-btn-primary tpl-btn-bg-color-success ">返回，放弃修改</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
               </div>
              </div>
	
	
	
        

    </div>

  <script src="${ctxStatic}/sdlyfp/js/jquery.min.js"></script>
  <script src="${ctxStatic}/sdlyfp/js/amazeui.min.js"></script>
  <script src="${ctxStatic}/sdlyfp/js/app.js"></script>
</body>
<script type="text/javascript">
$(document).ready(function() {
	
	var menuId = '${gtArea.menuId }';
	if(menuId)
	{
		$(".tpl-left-nav-menu").find("#"+menuId).addClass("active");
	}
	
	var message = "${message}";
	if(message)
	{
		var messageType = "${messageType}";
		msg(message,3000,messageType);
	}
});

function doSubmit()
{
	if(isNull("区域名称","name",'text')){return false;}
	if(isNull("类型","type",'select')){return false;}
	
	if(isNull("经济林任务目标","forestArea",'text')){return false;}
	if(isNull("经济林帮扶带动人口任务目标","forestPeople",'text')){return false;}
	if(isNull("护林岗位任务目标","rangerPost",'text')){return false;}
	if(isNull("龙头企业任务目标","leadCompany",'text')){return false;}
	if(isNull("合作社任务目标","coop",'text')){return false;}
	if(isNull("省定贫困村覆盖个数目标","countryTotal",'text')){return false;}
	return true;
}
</script>
</html>